#ifndef STEELBALLITEM_H
#define STEELBALLITEM_H

#include <QGraphicsObject>
#include "commondef.h"
#include <QTimer>
struct Obstacle
{
    int x,y,r;
};

class SteelBallItem : public QGraphicsObject
{
    Q_OBJECT
public:
    SteelBallItem();
    ~SteelBallItem();

    virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    virtual QRectF boundingRect() const;

    void collisionObstacle();
    void collisionBall();
    void collisionWall();
    void collisionObstacle2();
    void collisionObstacle3();
    bool IscollisionObstacle(const Obstacle& obstacle);

    void logic();
public:
    qreal       m_xvel,m_yvel,m_r;
    QPixmap     m_image;
    BALLSTATE   m_state;
    int         m_Index;
    Obstacle    m_obstacle;
public slots:
//    void logic();
};

#endif // STEELBALLITEM_H
